package net.xiduth.game.player.dialogues;

import net.xiduth.utils.ShopsHandler;

public class Jatix extends Dialogue {

	private int npcId;

	@Override
	public void start() {
		npcId = (Integer) parameters[0];
		sendNPCDialogue(npcId, 9827, "Hey " + player.getUsername()
				+ ", I'm Jatix. Would you like to see my shops?");
	}

	@Override
	public void run(int interfaceId, int componentId) {
		if (stage == -1) {
			sendOptionsDialogue("Select a Shop", "Armour Shop", "Ranging Shop",
					"Skills Shop", "Combat Gear", "Next Page");
			stage = 2;

		} else if (stage == 2) {
			if (componentId == OPTION_1) {
				ShopsHandler.openShop(player, 3);
				end();

			} else if (componentId == OPTION_2) {
				ShopsHandler.openShop(player, 4);
				end();

			} else if (componentId == OPTION_3) {
				ShopsHandler.openShop(player, 7);
				end();

			} else if (componentId == OPTION_4) {
				ShopsHandler.openShop(player, 9);
				end();

			} else if (componentId == OPTION_5) {
				sendOptionsDialogue("Select a Shop", "Gear Shop", "Magic Shop",
						"Hunting Shop", "Flask Shop");
				stage = 4;
			}

		} else if (stage == 4) {
			if (componentId == OPTION_1) {
				ShopsHandler.openShop(player, 10);
				end();

			} else if (componentId == OPTION_2) {
				ShopsHandler.openShop(player, 11);
				end();

			} else if (componentId == OPTION_3) {
				ShopsHandler.openShop(player, 29);
				end();
			}else if(componentId == OPTION_4){
				ShopsHandler.openShop(player, 66);
				end();
			}
		}
	}

	@Override
	public void finish() {

	}

}